home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Amoszine 8
/
Amoszine 8 (Disk 2 of 3).adf
/
Powerbobs.lha
/
powerbobsv1.0
/
examples
/
pbobsprite_col1.asc
< prev
next >
Wrap
Text File
|
1992-09-02
|
1KB
|
61 lines
'Collision detection between a Pbob and a lot of Sprites.
Screen Open 0,320,256,4,L
Hide On
Cls 0
Box 0,0 To 15,15
Text 4,10,"1"
Get Bob 1,0,0 To 16,16
Cls 0
Box 0,0 To 15,1
Get Bob 2,0,0 To 16,2
Make Mask
Bob Update Off
Sprite Update Off
Reserve Pbobs 1
Pbob Dbuf False
Pbob Height 1,16
Do
Locate 0,0
Print "Press a key to test speed"
Wait Key
Pbob Off 1
Bob Off
Bob Update
Pbob Update
Cls 0
Pbob 1,Rnd(200),Rnd(150)+20,1
Bob 1,X Pbob(1),Y Pbob(1),1
For I=8 To 63
X=Rnd(200) : Y=Rnd(220)+20
Sprite I,X+128,Y+50,2
Next
Set Psprite Colours 4
Convert Sprites 1
For I=8 To 63
Psprite I,X Sprite(I),Y Sprite(I),2
Next
Wait 10
Pbob Update
Wait Vbl
Psprite Update
T=Timer
For I=1 To 1000
A=Pbobsprite Fastcol(1,8 To 63)
Next
Print Timer-T
Hide On
Bob Update
Wait Vbl
Sprite Update
T=Timer
For I=1 To 1000
A=Bobsprite Col(1,8 To 63)
Next
Print Timer-T
Locate 27,0 : Print "8-35 36-63"
For I=8 To 35
Locate 27,I-7
Print Pfast Bobsprcol(I);Col(I),Pfast Bobsprcol(I+28);Col(I+28)
Next
Loop